package cn.mado.org.service.impl;

import cn.mado.basic.query.BaseQuery;
import cn.mado.org.domain.Novel;
import cn.mado.org.mapper.NovelMapper;
import cn.mado.org.service.NovelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class NovelServiceImpl implements NovelService {
    @Autowired
    private NovelMapper novelMapper;

    @Override
    public List<Novel> findNoveAll() {
        return novelMapper.findNoveAll();
    }

    @Override
    public List<Novel> findNove(BaseQuery baseQuery) {
        return novelMapper.findNove(baseQuery);
    }

    @Override
    public Integer findnovelTotals(BaseQuery baseQuery) {
        return novelMapper.findnovelTotals(baseQuery);
    }

    @Override
    public void delnovelByid(Long movieId) {
        novelMapper.delnovelByid(movieId);
    }

    @Override
    public void addnovel(Novel novel) {
        novel.setCreatetime(new Date());
        novelMapper.addnovel(novel);
    }

    @Override
    public void updatanovel(Novel novel) {
        novelMapper.updatanovel(novel);

    }
}
